package sg.edu.nus.iss.billing.privilege;

import java.util.ArrayList;
import java.util.List;

import sg.edu.nus.iss.billing.constant.PrivilegeConstants;
import sg.edu.nus.iss.billing.gui.MenuFunction;

public class MenuFunctionsFactory {
	
	
	
	public static List<MenuFunction> getAccessFunctions(Class classType) {
		List<MenuFunction> result = new ArrayList<MenuFunction>();
		if (classType == AgentRole.class) {
			result.add(new MenuFunction(PrivilegeConstants.VIEW_BILL_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.VIEW_CUST_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.LOG_COMPLAINT_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.VIEW_COMPLAINT_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.UPDATE_COMPLAINT_FUNC));
		}else if (classType == AdminRole.class) {
			result.add(new MenuFunction(PrivilegeConstants.ADD_CUST_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.UPDATE_CUST_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.ADD_SUBS_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.DEREG_CUST_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.DEREG_SUBS_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.VIEW_SUBS_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.UPDATE_SUBS_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.GENERATE_BILL_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.ADD_USER_FUNC));
			result.add(new MenuFunction(PrivilegeConstants.UPDATE_USER_FUNC));
		}
		return result;
	}

}
